package com.web.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.web.dao.TWinResultDao;
import com.web.model.TWinResult;
import com.web.service.TWinResultService;
import com.web.model.PageBean;
import com.web.utils.Pager;

/**
 * 开奖结果 Service实现
 * @author wzy
 * 
 */
@Service
public class TWinResultServiceImpl implements TWinResultService{

	//protected Log log = LogFactory.getLog(getClass());
	@Autowired
	private TWinResultDao winResultDao;//注入TWinResult的dao
	
	
	public int insert(TWinResult winResult){
		return winResultDao.insert(winResult);
	}
	
	
	public int deleteByPrimaryKey(Long resultId){
		return winResultDao.deleteByPrimaryKey(resultId);
	}
	
	
	public int updateByPrimaryKey(TWinResult winResult){
		return winResultDao.updateByPrimaryKey(winResult);
	}

	
	public TWinResult selectByPrimaryKey(Long resultId){
		return winResultDao.selectByPrimaryKey(resultId);
	}
	
	
	
	public List<TWinResult> selectList(Map<String,Object> map){
		return winResultDao.selectList(map);
	}
	
	
	public PageBean<TWinResult> selectListByPage(Map<String,Object> map){
		Pager.addPage(map);
		Integer count = winResultDao.selectListCount(map);
		List<TWinResult> list = winResultDao.selectList(map);
		PageBean<TWinResult> pageList = new PageBean<TWinResult>(list);
		pageList.setTotal(count);
		pageList.setList(list);
		pageList.setPageNum((Integer)map.get("pageNum"));
		pageList.setPageSize((Integer)map.get("pageSize"));
		pageList.setPages(Pager.getPages(count, (Integer)map.get("pageSize")));
		return pageList;
	}
	
	
	public TWinResult selectByModelSelective(TWinResult winResult){
		return winResultDao.selectByModelSelective(winResult);
	}
	
	
	public int selectListCount(Map<String, Object> map){
		return winResultDao.selectListCount(map);
	}

	
	public void insertList(List<TWinResult> list) {
		// TODO Auto-generated method stub
		
	}
}
